package com.example.administrator.ksf_zty.BrineActivity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.RelativeLayout;

import com.example.administrator.ksf_zty.MaterialActivity.MaterialMenuActivity;
import com.example.administrator.ksf_zty.R;
import com.example.administrator.ksf_zty.util.BaseActivity;
import com.example.administrator.ksf_zty.util.TitleUtils;

public class BrineJarYScanActivity extends BaseActivity {


    ImageButton back;
    Button titleButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_brine_jar_yscan);
        SetTitle();
        SetOnClick();
    }

    //给按钮设置事件
    private void SetOnClick() {
        //保存按钮
        Button btnSave = (Button) findViewById(R.id.BrineJarYScan_btnSave);
        btnSave.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //查询详情按钮
        Button btnSel = (Button) findViewById(R.id.BrineJarYScan_btnSel);
        btnSel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineJarYScanActivity.this, BrineJarYScanDetailsActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //提交按钮
        Button btnSubmit = (Button) findViewById(R.id.BrineJarYScan_btnSubmit);
        btnSubmit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //返回按钮
        Button btnCancel = (Button) findViewById(R.id.BrineJarYScan_btnCancel);
        btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(BrineJarYScanActivity.this, BrineMenuActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
    }

    //设置Title
    private void  SetTitle()
    {
        back = (ImageButton) findViewById(R.id.back);
        titleButton = (Button) findViewById(R.id.titleButton);
        //设置标题(第三个参数是标题文字，直接替换""内容即可，第五个参数是标题右边按钮文字，第六个参数是设置是否显示返回按钮)
        TitleUtils.setTitle(this, R.id.title_sys_set, "盐罐投料扫描", this,
                "", true);
        //返回按钮事件
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }
}
